<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<html>
	<head>
		<title>展示学生信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content">
				<div id="header">
					<div id="rightheader">
						<p>
							2019/10/1
							<br />
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="javascript:void(0)">main</a>
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
					</h1>
					<form action="${pageContext.request.contextPath}/student/showStudents.do">
					    姓名：  <input type="text" name="sname"/>
					    <%--年龄:   <input type="text"/>--%>
							    <input type="submit"/>
					</form>
					<form method="post" action="${pageContext.request.contextPath}/student/removeAny.do">
					<table class="table">
						<tr class="table_header">
						    <td>
							   	全选
							</td>
							<td>
								编号
							</td>
							<td>
								姓名
							</td>
							<td>
								年龄
							</td>
							<td>
								头像
							</td>
							<td>
								下载量
							</td>
							<td>
								操作
							</td>
						</tr>
						<c:forEach var="s" items="${list}">
							<tr>
								<td>
								   <input type="checkbox" name="ids" value="${s.id}"/>
								</td>
								<td>
										${s.id}
								</td>
								<td>
										${s.sname}
								</td>
								<td>
										${s.age}
								</td>
								<td>
										<img src="/upload/${s.newfilename}" height="20" width="30"/>
								</td>
								<td>
										${s.downcount}
								</td>
								<td>
									<a href="${pageContext.request.contextPath}/student/removeOne.do?id=${s.id}">删除</a>&nbsp;
									<a href="${pageContext.request.contextPath}/student/getOne.do?id=${s.id}">修改</a>&nbsp;
									<a href="${pageContext.request.contextPath}/student/download.do?id=${s.id}">下载</a>
								</td>
							</tr>
						</c:forEach>
					</table>


						<div>
							<c:if test="${pageNum>1}">
								<a href="${pageContext.request.contextPath}/student/showStudents.do?pageNum=1&sname=#{sname}">
									首页
								</a>
								<a href="${pageContext.request.contextPath}/student/showStudents.do?pageNum=${pageNum-1}&sname=#{sname}">
									上一页
								</a>
							</c:if>
								当前是第${pageNum}页/总共有${totalPage}页
							<c:if test="${pageNum<totalPage}">
								<a href="${pageContext.request.contextPath}/student/showStudents.do?pageNum=${pageNum+1}&sname=#{sname}">
									下一页
								</a>
								<a href="${pageContext.request.contextPath}/student/showStudents.do?pageNum=${totalPage}&sname=#{sname}">尾页</a>
							</c:if>
						</div>

					  <input type="submit" value="删除勾选项"/>
					</form>
					<div>
						<a href="${pageContext.request.contextPath}/student/addStudent.jsp" style="display: block">添加新生</a>
					</div>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
				ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
